using System;
using System.Reflection;
using NBody;
using NBody.InitialConditions;
using OptionParser;

[assembly: AssemblyTitle ("NBodyRandomCube")]
[assembly: AssemblyVersion ("1.0.*")]
[assembly: AssemblyDescription ("Create a system of random particles within a cube of\n\tside length one.")]
[assembly: AssemblyCopyright ("2005 Joseph D. MacMillan")]

public class RandomCubeOptions : OutputGetOptions
{
    [Option ("-n", "Number of particles")]
    public int N;
    
    [Option ("-s", "Random number seed")]
    public int RandomSeed;
    
    [Option ("-l", "Length of the box")]
    public double BoxLength;
    
    [Option ("-m", "Total mass within the box")]
    public double Mass;
    
    public RandomCubeOptions()
    {
        N = 10000;
        RandomSeed = 4343876;
        BoxLength = 1.0;
        Mass = 1.0;
    }
}

public class NBodyRandomCube
{
    public static void Main(string[] args)
    {
        RandomCubeOptions opts = new RandomCubeOptions();
        opts.ProcessArgs(args);
        
        Cube cube = new Cube(opts.BoxLength, opts.Mass, Cube.Origin.Centre);
        NBodySystem s = cube.GenerateRandom(opts.N, 0.0, new Random(opts.RandomSeed));
        s.Write(opts.OutFile);            
    }
}
